const pool = require('../db'),
    app = require('./server');

app.get('/api/category', (req, res) => {
    pool.query('select * from news_cate', (e, results) => {
        if (e) res.send({code: 2, message: '查询分类失败', error: e.message})
        else res.send({code: 0, message: 'success', data: results})
    })
})